package vip.xiaonuo.smzq.core.enums;

import lombok.Getter;

/**
 * @description: 审核级别枚举
 * @create: 2021-06-18 14:13
 **/
@Getter
public enum AuditphaseEnum {
    /**
     * 审核级别枚举
     * 0：矿级
     * 1：县级
     * 2：市级
     * 3：省级
     * 4：部级
     * 5：完结
     */
    W_J("完结","SUCESS",0,5),
    B_J("部级", "MINISTRY",0,4),
    S_J("省级","PROVINCE",2,3),
    SH_J("市级","CITY",4,2),
    X_J("县级","COUNTY",6,1),
    K_J("矿级","MININGAREA",0,0);

    private String name;
    private String code;
    private Integer sub;
    private Integer value;

    AuditphaseEnum(String name, String code,Integer sub,Integer value){
        this.name = name;
        this.code = code;
        this.sub = sub;
        this.value = value;
    }

    public static AuditphaseEnum getByCode(String code){
        for (AuditphaseEnum auditphaseEnum : AuditphaseEnum.values()) {
            if (auditphaseEnum.getCode().equals(code)) {
                return auditphaseEnum;
            }
        }
        return null;
    }

    public static String getCodeByValue(Integer value){
        for (AuditphaseEnum auditphaseEnum : AuditphaseEnum.values()) {
            if (auditphaseEnum.getValue().equals(value)) {
                return auditphaseEnum.getCode();
            }
        }
        return null;
    }
}
